17The Philistines heard that they had anointed David king over Israel, and all the Philistines went up to seek David. And David heard about it and went down to the stronghold.18The Philistines came and spread out in the Valley of Rephaim.19David inquired of the LORD, "Shall I go up against the Philistines? Will you give them into my hand?" The LORD said to David, "Go up, for I will give the Philistines into your hand."20David came to Baal-perazim and struck them down there. David said, "The LORD has broken through my enemies before me like a breakthrough of waters." Because of this, he called that place Baal-perazim.21They abandoned their idols there, and David and his men carried them away.22The Philistines came up again and spread out in the Valley of Rephaim.23David inquired of the LORD, and he said, "Do not go up. Turn around behind them and come at them from the opposite side of the balsam trees."24When you hear the sound of marching in the tops of the bacas, then act decisively, for then the LORD has gone out before you to strike the Philistine camp.25David did just as the LORD had commanded him, and he struck down the Philistines from Geba all the way to the entrance to Gezer.